#ifndef DOC_MANAGER_H
#define DOC_MANAGER_H

#include <string>
#include <iostream>

#include "sqlite3.h"

class DocManager {
public:
    DocManager();
    ~DocManager();

    int LoadDB(std::string &db);
    int WriteDoc(std::string &title, std::string &body);

    int GetDocID(std::string &title);
    std::string GetTitle(int docID);
    std::string GetBody(int docID);
    int GetDocCount();
private:
    std::string dbPath_;
    sqlite3 *db_;
    sqlite3_stmt *getDocID_;
    sqlite3_stmt *updateDoc_;
    sqlite3_stmt *insertDoc_;
    sqlite3_stmt *getTitle_;
    sqlite3_stmt *getBody_;
    sqlite3_stmt *getDocCount_;
};

#endif
